import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class File {
    private FCB fcb;
    //父目录
    private File father;
    //子目录
    private List<File> sonList;


    public File getFather() {
        return father;
    }

    public List<File> getSonList() {
        return sonList;
    }

    public FCB getFcb() {
        return fcb;
    }

    public File(String fileName, int size, boolean isFile, File father) {
        this.fcb = new FCB(fileName, isFile, size);
        this.father = father;
        this.sonList = new ArrayList<>(0);
    }

    public boolean addNewSonFile(File sonFile) {
        try {
            this.sonList.add(sonFile);
        } catch (Exception e) {
            return false;
        }
        return true;
    }

    public Date getCreateDate() {
        return fcb.getCreateDate();
    }

    public void setVisitDate(Date visitDate) {
        fcb.setVisitDate(visitDate);
    }
}
